<?
ini_set('display_errors', 'Off');
date_default_timezone_set('Asia/Colombo');
$username = $_SESSION["Juname"];
$pass = $_SESSION["Jpass"];
$gmailserver="{imap.gmail.com:993/imap/ssl}";
$gmailuser="careers@eyepax.com";
$gmailpass="Ep2685107";
$boxname="INBOX";
//$DBuser="emraji";
//$DBpass="zaq1xsw2!@#$";
$DBname="emailtojiratest";
$DBuser="emrajitest";
$DBpass="zaq1xsw2!@#$";
$DBserver="localhost";
$jirauser="careers";
$jirapass="Ep2685107";
$project="TEST";
$host="eyepax.atlassian.net";
$admingroupname="administrators";
$authgroup="Interview - APP";

$currentstatuses=array(
					"OpenCV",
					"Short Listed",
					"Interviewed",
					"Tested",
					"Selected",
					"Rejected",
					"Offered",
					"Interview Called",
					"Test Called",
					"Final Interview Call",
					"Final Interviewed",
					"Joined"					
);
//=================mail configurations================================

//general conf
$location=array(
		"Mumbai",
		"Helsinki",
		"Lisbon",
		"Sydney",
		"Other"
);
$testtype=array(
		"Practical",
		"IQ"
);
$AddReplyTo="poornima.s@eyepax.com";
$icalorganizer="poornima.s@eyepax.com";
$fromname="Eyepax IT Consulting Pvt. Ltd.";

//cron calendar to mail job

$cronsubject="(Recruitment) Daily Test Summary - ".date('Y-m-d')."";

//acknowledgement
$acknowledgement="Acknowledgement";
$mailrecieveddes="Dear {APPLICANT NAME} <br>Thankyou for your interest in Eyepax IT Consulting. We have recieved your application and we will get back to you once your application is reviewed.<br>Thankyou<br>";

//interview call
$interviewcalledsubject="Call for Interview";
$inviteecalendarsubject="[Recruitment] First Interview - {JOB POST} - {APPLICANT NAME}";
$interviewdateinform= "<div style='font-weight:normal; font-family:helvetica,sans-serif; color:#333;'>Dear {APPLICANT NAME},<br><br>Eyepax IT Consulting would like to inform you that you have been shortlisted for the post of {JOB POST}.<br>Please be kind enough to confirm your attendance for preliminary interview on the below said date and time.<br><br>Venue: Eyepax IT Consulting (Pvt), 66, Norris Canal Road, Colombo 10. (Tel: 011-7392160)<br>Date: {DATE}<br>Time: {TIMEFROM} to {TIMETO}<br><br>To get us a idea about your self,we would like you to answer few questions we have prepared.<br>To get started, please go to the following link and fill in the questionnaire.<br><br><a href='www.eyepax.com/recruitform/index.php?vcode={VCODE}'>Go To The Form</a><br><br>If you're prompted to enter a code, please use the following :<br>CODE : {VCODE}<br><br>We would really appreciate if you could fill in this  before you attend to the interview.<br>Call or reply to this email to confirm your attendance.<br><br>For more details visit our <a href='www.eyepax.com'>website</a><br><br><a href='https://www.youtube.com/watch?v=--1AY5Bw7Ao'>Eyepax Corporate Recruitment Video</a><br><br>Thank You.<br><br>Best regards,<br><br>Poornima Siriwardana<br>Office Manager<br>Mobile +94-(0)71-4959 771 | <a href='mailto:poornima.s@eyepax.com'>poornima.s@eyepax.com</a><br>Eyepax IT Consulting (Pvt) Ltd, 66, Norris Canal Road, Colombo 10, Sri Lanka<br>Tel +94-(0)-11-7392 160 | Fax +94-(0)11-2685 107 | <a href='www.eyepax.com'>www.eyepax.com</a></div>";
$notifyinterview="Hi \nA interview has been scheduled on {DATE} at {TIMEFROM} to {TIMETO}.The applicant name is {APPLICANT NAME}.\n Please refer the following link(s) for more details\n\n{LINK}\n{FORMLINK}\n\nYou can go to the relevant JIRA task by clicking the following link.\nhttps://eyepax.atlassian.net/browse/{PROJECT}\n\nThank you.";

//test call
$testcalledsubject="Call for {TEST TYPE} Test";
$testinviteecalendarsubject="[Recruitment] {TEST TYPE} Test - {JOB POST} - {APPLICANT NAME}";
$testdateinform= "<div style='font-weight:normal; font-family:helvetica,sans-serif; color:#333;'>Dear {APPLICANT NAME},<br><br>This is regarding your application for the post of {JOB POST}.<br>Eyepax IT Consulting would appreciate it if you would come over for a {TEST TYPE} test, for which the details have been mentioned below.<br><br>Venue: Eyepax IT Consulting (Pvt), 66, Norris Canal Road, Colombo 10. (Tel: 011-7392160)<br>Date: {DATE}<br>Time: {TIMEFROM} to {TIMETO}<br><br>To get us a idea about your self,we would like you to answer few questions we have prepared.<br>To get started, please go to the following link and fill in the questionnaire.<br><br><a href='www.eyepax.com/recruitform/index.php?vcode={VCODE}'>Go To The Form</a><br><br>If you're prompted to enter a code, please use the following :<br>CODE : {VCODE}<br><br>We would really appreciate if you could fill in this  before you attend to the Test.<br>Call or reply to this email to confirm your attendance.<br><br>For more details visit our <a href='www.eyepax.com'>website</a><br><br><a href='https://www.youtube.com/watch?v=--1AY5Bw7Ao'>Eyepax Corporate Recruitment Video</a><br><br>Thank You.<br>Best regards,<br>Poornima Siriwardana<br>Office Manager<br>Mobile +94-(0)71-4959 771 | <a href='mailto:poornima.s@eyepax.com'>poornima.s@eyepax.com</a><br>Eyepax IT Consulting (Pvt) Ltd, 66, Norris Canal Road, Colombo 10, Sri Lanka<br>Tel +94-(0)-11-7392 160 | Fax +94-(0)11-2685 107 | <a href='www.eyepax.com'>www.eyepax.com</a></div>";
$testdateinform2="<div style='font-weight:normal; font-family:helvetica,sans-serif; color:#333;'>Dear {APPLICANT NAME},<br><br>This is regarding your application for the post of {JOB POST}.<br>Eyepax IT Consulting would appreciate it if you would come over for a {TEST TYPE} test, for which the details have been mentioned below.<br><br>Venue: Eyepax IT Consulting (Pvt), 66, Norris Canal Road, Colombo 10. (Tel: 011-7392160)<br>Date: {DATE}<br>Time: {TIMEFROM} to {TIMETO}<br><br>Call or reply to this email to confirm your attendance.<br><br>For more details visit our <a href='www.eyepax.com'>website</a><br><br><a href='https://www.youtube.com/watch?v=--1AY5Bw7Ao'>Eyepax Corporate Recruitment Video</a><br><br>Thank You.<br>Best regards,<br>Poornima Siriwardana<br>Office Manager<br>Mobile +94-(0)71-4959 771 | <a href='mailto:poornima.s@eyepax.com'>poornima.s@eyepax.com</a><br>Eyepax IT Consulting (Pvt) Ltd, 66, Norris Canal Road, Colombo 10, Sri Lanka<br>Tel +94-(0)-11-7392 160 | Fax +94-(0)11-2685 107 | <a href='www.eyepax.com'>www.eyepax.com</a></div>";
$notifytest="Hi \nA {TEST TYPE} Test has been scheduled on {DATE} at {TIMEFROM} to {TIMETO}.The applicant name is {APPLICANT NAME}.\n Please refer the following link(s) for more details\n\n{LINK}\n{FORMLINK}\n\nYou can go to the relevant JIRA task by clicking the following link.\nhttps://eyepax.atlassian.net/browse/{PROJECT}\n\nThank you.";

//final Interview call
$finalinterviewsubject="Call for Final Interview";
$finalinviteecalendarsubject="[Recruitment] Final Interview - {JOB POST} - {APPLICANT NAME}";
$finalinterviewdateinform2="<div style='font-weight:normal; font-family:helvetica,sans-serif; color:#333;'>Dear {APPLICANT NAME},<br><br>Eyepax IT Consulting would like to inform you that you have been shortlisted for the post of {JOB POST}.<br>Please be kind enough to confirm your attendance for Final interview on the below said date and time.<br><br>Venue: Eyepax IT Consulting (Pvt), 66, Norris Canal Road, Colombo 10. (Tel: 011-7392160)<br>Date: {DATE}<br>Time: {TIMEFROM} to {TIMETO}<br><br>Please complete our online form via the link :<br> www.eyepax.com/recruitform/index.php?vcode={VCODE}<br><br>Call or reply to this email to confirm your attendance.<br><br>For more details visit our <a href='www.eyepax.com'>website</a><br><br><a href='https://www.youtube.com/watch?v=--1AY5Bw7Ao'>Eyepax Corporate Recruitment Video</a><br><br>Thank You.<br><br>Best regards,<br><br>Poornima Siriwardana<br>Office Manager<br>Mobile +94-(0)71-4959 771 | <a href='mailto:poornima.s@eyepax.com'>poornima.s@eyepax.com</a><br>Eyepax IT Consulting (Pvt) Ltd, 66, Norris Canal Road, Colombo 10, Sri Lanka<br>Tel +94-(0)-11-7392 160 | Fax +94-(0)11-2685 107 | <a href='www.eyepax.com'>www.eyepax.com</a></div>";
$finalinterviewdateinform= "<div style='font-weight:normal; font-family:helvetica,sans-serif; color:#333;'>Dear {APPLICANT NAME},<br><br>Eyepax IT Consulting would like to inform you that you have been shortlisted for the post of {JOB POST}.<br>Please be kind enough to confirm your attendance for Final interview on the below said date and time.<br><br>Venue: Eyepax IT Consulting (Pvt), 66, Norris Canal Road, Colombo 10. (Tel: 011-7392160)<br>Date: {DATE}<br>Time: {TIMEFROM} to {TIMETO}<br><br>Call or reply to this email to confirm your attendance.<br><br>For more details visit our <a href='www.eyepax.com'>website</a><br><br><a href='https://www.youtube.com/watch?v=--1AY5Bw7Ao'>Eyepax Corporate Recruitment Video</a><br><br>Thank You.<br><br>Best regards,<br><br>Poornima Siriwardana<br>Office Manager<br>Mobile +94-(0)71-4959 771 | <a href='mailto:poornima.s@eyepax.com'>poornima.s@eyepax.com</a><br>Eyepax IT Consulting (Pvt) Ltd, 66, Norris Canal Road, Colombo 10, Sri Lanka<br>Tel +94-(0)-11-7392 160 | Fax +94-(0)11-2685 107 | <a href='www.eyepax.com'>www.eyepax.com</a></div>";
$notifyfinalinterview="Hi \nA final interview has been scheduled on {DATE} at {TIMEFROM} to {TIMETO}.The applicant name is {APPLICANT NAME}.\n Please refer the following link(s) for more details\n\n{LINK}\n{FORMLINK}\n\nYou can go to the relevant JIRA task by clicking the following link.\nhttps://eyepax.atlassian.net/browse/{PROJECT}\n\nThank you.";

//offer
$offersubject="Offer of Employment :: Join Eyepax Team";
$offerinform="<div style='font-weight:normal; font-family:helvetica,sans-serif; color:#333;'>Dear {APPLICANT NAME},<br><br>Its with great pleasure that we inform you that you have been selected for the post of {JOB POST}. We would like you to follow up on this email for us to finalize your appointment.<br><br>We would like you to join Eyepax Team from {DATE}. And your total compensation as discussed, would be Rs. {Salary}.  Please reply this email immediately if you are unable to make it on this day. Or Call Poornima on +94-(0)71-4959 771. <br><br>Please reply this mail and acknowledge that you have received it.<br><br>REF : {REFERENCE}<br><br>For more details visit our <a href='www.eyepax.com'>website</a><br><br><a href='https://www.youtube.com/watch?v=--1AY5Bw7Ao'>Eyepax Corporate Recruitment Video</a><br><br>Wish you the best.<br><br>yours,<br><br>HR Team<br>Poornima Siriwardana<br>Office Manager<br>Mobile +94-(0)71-4959 771 | <a href='mailto:poornima.s@eyepax.com'>poornima.s@eyepax.com</a><br>Eyepax IT Consulting (Pvt) Ltd, 66, Norris Canal Road, Colombo 10, Sri Lanka<br>Tel +94-(0)-11-7392 160 | Fax +94-(0)11-2685 107 | <a href='www.eyepax.com'>www.eyepax.com</a></div>";

//selected
$selectedsubject="Potential date of joining";
$selectedinform="<div style='font-weight:normal; font-family:helvetica,sans-serif; color:#333;'>Dear {APPLICANT NAME},<br><br>This is to inform you that the interview was successful. Therefore for us to proceed further, we would like to know the earliest date that you could join us in the event that you are confirmed for the post of {JOB POST}.<br>Awaiting a prompt reply! <br><br>For more details visit our <a href='www.eyepax.com'>website</a><br><br><a href='https://www.youtube.com/watch?v=--1AY5Bw7Ao'>Eyepax Corporate Recruitment Video</a><br><br>Thank You.<br><br>Best regards,<br><br>Poornima Siriwardana<br>Office Manager<br>Mobile +94-(0)71-4959 771 | <a href='mailto:poornima.s@eyepax.com'>poornima.s@eyepax.com</a><br>Eyepax IT Consulting (Pvt) Ltd, 66, Norris Canal Road, Colombo 10, Sri Lanka<br>Tel +94-(0)-11-7392 160 | Fax +94-(0)11-2685 107 | <a href='www.eyepax.com'>www.eyepax.com</a></div>";

$action_one="OpenCV";
$action_two="Short Listed";
$action_three="Interviewed";
$action_four="Tested";
$action_five="Selected";
$action_six ="Rejected"; 
$action_seven="Offered";
$action_eight="Interview Called";
$action_nine="Test Called";
$action_ten="Joined";
$action_eleven="Final Interview Called";
$action_twelve="Final Interviewed";


$action_one_des="created Task on JIRA by <b>".$jirauser."</b> on <b>".date("Y-m-d H:i:s",time()).'</b>';
$action_two_des = 'changed to <b>Short Listed</b> by <b>'.$username."</b> on <b>".date("Y-m-d H:i:s",time()).'</b>';
$action_three_des= 'Changed the status to <b>Interviewd</b> by <b>'.$username."</b> on <b>".date("Y-m-d H:i:s",time()).'</b>';
$action_four_des='The status was changed to <b>Tested</b> by <b>'.$username."</b> on <b>".date("Y-m-d H:i:s",time()).'</b>';
$action_five_des = 'changed to <b>Selected</b> by <b>'.$username."</b> on <b>".date("Y-m-d H:i:s",time()).'</b>';
$action_six_des='The Task was marked as <b>Rejected</b> by <b>'.$username."</b> on <b>".date("Y-m-d H:i:s",time()).'</b>';
$action_seven_des='The Task was marked as <b>Offered</b> by <b>'.$username."</b> on <b>".date("Y-m-d H:i:s",time()).'</b>';
$action_eight_des='The Task was marked as <b>Interview Called</b> by <b>'.$username."</b> on <b>".date("Y-m-d H:i:s",time()).'</b>';
$action_nine_des='The Task changed to <b>Test Called</b> by <b>'.$username."</b> on <b>".date("Y-m-d H:i:s",time()).'</b>';
$action_ten_des='The Task was marked as <b>Joined</b> by <b>'.$username."</b> on <b>".date("Y-m-d H:i:s",time()).'</b>';
$action_eleven_des='The Task was marked as <b>Final Interview Called</b> by <b>'.$username."</b> on <b>".date("Y-m-d H:i:s",time()).'</b>';
$action_twelve_des='The Task was marked as <b>Final Interviewed</b> by <b>'.$username."</b> on <b>".date("Y-m-d H:i:s",time()).'</b>';

//cron jira descriptions

$action_one_des_jira="[JIRA] created Task on JIRA by <b>{modifier}</b> on <b>".date("Y-m-d H:i:s",time()).'</b>';
$action_two_des_jira = "[JIRA] changed to <b>Short Listed</b> by <b>{modifier}</b> on <b>".date("Y-m-d H:i:s",time()).'</b>';
$action_three_des_jira= "[JIRA] Changed the status to <b>Interviewd</b> by <b>{modifier}</b> on <b>".date("Y-m-d H:i:s",time()).'</b>';
$action_four_des_jira="[JIRA] The status was changed to <b>Tested</b> by <b>{modifier}</b> on <b>".date("Y-m-d H:i:s",time()).'</b>';
$action_five_des_jira = "[JIRA] changed to <b>Selected</b> by <b>{modifier}</b> on <b>".date("Y-m-d H:i:s",time()).'</b>';
$action_six_des_jira="[JIRA] The Task was marked as <b>Rejected</b> by <b>{modifier}</b> on <b>".date("Y-m-d H:i:s",time()).'</b>';
$action_seven_des_jira="[JIRA] The Task was marked as <b>Offered</b> by <b>{modifier}</b> on <b>".date("Y-m-d H:i:s",time()).'</b>';
$action_eight_des_jira="[JIRA] The Task was marked as <b>Interview Called</b> by <b>{modifier}</b> on <b>".date("Y-m-d H:i:s",time()).'</b>';
$action_nine_des_jira="[JIRA] The Task changed to <b>Test Called</b> by <b>{modifier}</b> on <b>".date("Y-m-d H:i:s",time()).'</b>';
$action_ten_des_jira="[JIRA] The Task was marked as <b>Joined</b> by <b>{modifier}</b> on <b>".date("Y-m-d H:i:s",time()).'</b>';
$action_eleven_des_jira="[JIRA] The Task was marked as <b>Final Interview Called</b> by <b>{modifier}</b> on <b>".date("Y-m-d H:i:s",time()).'</b>';
$action_twelve_des_jira="[JIRA] The Task was marked as <b>Final Interviewed</b> by <b>{modifier}</b> on <b>".date("Y-m-d H:i:s",time()).'</b>';

// user Authentication check

if(!isset($_SESSION['first_log'])){
    header('Location:index.php');
}

?>